<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>截取字符串demo</title>
</head>
<body>
<script>
    var data='123,789';

    //dddd(data);
    function dddd(value) {
        var splitvalue=value.split(',');

        var reValues=[];

        for ( var i=0; i<splitvalue.length; i++ ){
            var reValue={};
            reValue.name=splitvalue[i];
            reValues[i]=reValue;
        }
        console.log(JSON.stringify(reValues));
        return reValues;
    }


    var arrList=[1,2,3,4,5,6];
    var spliceList=arrList.splice(3);
    console.log(spliceList);

    var ws=new WebSocket('wss://echo.websocket.org');

    ws.onopen = function(evt) {
        console.log("Connection open ...");
        ws.send("Hello WebSockets!");
    };

    ws.onmessage = function(evt) {
        console.log( "Received Message: " + evt.data);
        ws.close();
    };

    ws.onclose = function(evt) {
        console.log("Connection closed.");
    };


</script>
</body>
</html>